<template>
    <div id="editor">
        <input :value="value" name="body" type="hidden"/>
        <mavon-editor v-model="value" style="height: 100%"/>
    </div>
</template>

<script>

    import {mavonEditor} from 'mavon-editor'
    import 'mavon-editor/dist/css/index.css'
    Vue.use(mavonEditor);

    export default {
        name: "editor",
        props:["type","body"],
        data() {
            return { value: '' }
        },
        created(){
            this.value = this.type=="edit"?this.body:"";
        },
        components:{
            mavonEditor
        }
    }

</script>

<style scoped>
#editor{
    height:580px;
}
</style>